<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:replace="layouts::header"></head>

<body>
<nav th:replace="layouts::navbar"></nav>
    <div class="container">
        <h3>书架</h3>
        <hr>
        <!--新增学生按钮-->
        <a th:href="@{/borrows/new}" class="btn btn-primary btn-sm mb-3">加入图书</a>
        <br>
        <table class="table table-bordered table-striped">
            <thead class="thread-dark">
            <tr>
                <th>借阅的书本</th>
                <th>加入时间</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
            <tr th:each="aBorrow : ${borrows}">
                <td th:text="${aBorrow.BorrowBook}"></td>
                <td th:text="${aBorrow.BorrowTime}"></td>
<!--                <td th:text="${aBorrow.GiveBackTime}"></td>-->
                <td>
                    <a th:href="@{/borrows/update(id=${aBorrow.bookId})}" class="btn btn-info btn-sm">更新</a>
                    <a
                            th:href="@{/borrows/delete(id=${aBorrow.bookId})}"
                            class="btn btn-danger btn-sm"
                            onclick="if (!(confirm('确定要删除这本书吗？'))) return false"
                    >删除</a>
                </td>
            </tr>
            </tbody>
        </table>
    </div>
</body>
</html>